import QtQuick 1.1
import com.nokia.symbian 1.1

import "cores.js" as Cores
import "util.js" as Util

Rectangle {
    id: root
    width: parent.width; height: colMain.height + 10
    color: (infoContato == undefined ? (vagaNova ? configuracao.corVagaNova : platformStyle.colorNormalDark) : configuracao.corVagaContatada)

    signal clique(int codigoVaga)
    signal segurandoDedo(int codigoVaga)

    Column {
        id: colMain
        width: parent.width
        spacing: 4
        z: 1

        Column {
            width: parent.width
            Text {
                id: txtCargoView
                width: parent.width
                text: cargo
                font.pixelSize: 20
                color: platformStyle.colorNormalLight
                wrapMode: Text.WordWrap
            }
            Text {
                width: parent.width
                text: empresa
                font.pixelSize: 18
                color: platformStyle.colorNormalLight
                wrapMode: Text.WordWrap
            }
            Row {
                width: parent.width
                spacing: 15
                Image {
                    id: bandeira
                    source: "qrc:///estados/" + estado
                    width: 32; height: 26
                    MouseArea {
                        width: parent.width; height: parent.height
                        preventStealing: true
                        onClicked: {
                            tooltipBandeira.abrirToolTip();
                        }
                    }
                }
                ToolTipAnimado {
                    id: tooltipBandeira
                    alvo: bandeira
                    texto: Util.SiglaParaEstado(estado);
                }
                Text {
                    width: parent.width - bandeira.width
                    text: cidade
                    font.pixelSize: 18
                    color: platformStyle.colorNormalLight
                    wrapMode: Text.WordWrap
                }
            }
        }
        Rectangle {
            width: parent.width; height: 1
            color: platformStyle.colorNormalLight
        }
    }

    Image {
        id: imageGood
        width: 32; height: 32
        x: colMain.width - imageGood.width; y: txtCargoView.y;
        source: "qrc:///good"
        visible: marcado
    }

    MouseArea {
        width: parent.width; height: parent.height
        onClicked: {
            root.clique(codigoVaga);
        }
        onPressAndHold: {
            root.segurandoDedo(codigoVaga);
        }
    }
}
